//
//	Shared stuff :
//

struct ENetPacket_s {
		ENetPacket_s (void) {
			Fill(0);
		}

		void Fill(char ch) {
			memset(this, ch, sizeof(*this));
		}
		
		char data[1000];
	};
	
	
const uint MAX_PACKET_SIZE = sizeof(ENetPacket_s);




#define CHECK_WSA(expr) do {						\
		if ((expr)==SOCKET_ERROR) {					\
			throw exception(NET_ErrorString());		\
		}											\
	} while(0);

													
#define CHECK_SOCKET(socket) do {					\
		if (socket==INVALID_SOCKET) {				\
			throw exception(NET_ErrorString());		\
		}											\
	} while (0);

bool wait(int expr) 
{
	if (expr==SOCKET_ERROR) {
		if (WSAGetLastError()==WSAEWOULDBLOCK) {
			return false;
		} else {
			throw exception(NET_ErrorString());
		}
	}
	return true;
}	

